package com.springboot.study.tests.designpattern.decoreator2;

/**
 * @Author: guodong
 * @Date: 2021/5/6 11:05
 * @Version: 1.0
 * @Description:
 */
public class Test {

    public static void main(String[] args){
        Battercake  battercake = new MustBattercake();
        //煎饼有点小，想再加一个鸡蛋
        battercake = new EggDecorator(battercake);
        //再加一个鸡蛋
        battercake = new EggDecorator(battercake);
        //很饿，再加根香肠
        battercake = new SausageDecorator(battercake);

        System.out.println(battercake.getMsg() + ",总价" + battercake.getPrice());
    }

}
